import httpx
import json
def updateContact():
    r = httpx.put('http://127.0.0.1:8000/rest/Contact/', json={'id':1185,
        'yonghu': '111',
        "yiqixinghao":"1185==",
        "yiqibh":"1185==",
        "baoxiang":"String",
        "shenhe":"String",
        "yujifahuo_date":"2021-10-02",
        "hetongbh":"String",
        "addr":"String",
        "channels":"String",
        "tiaoshi_date":"2021-10-02",
        "method":"String",
        "work_month":"2001-01-01"})
    print(r,dir(r))
    print(r.text)
def newContact():
    r = httpx.post('http://127.0.0.1:8000/rest/Contact/', json={'yonghu': '111',
        "yiqixinghao":" String",
        "yiqibh":"String",
        "baoxiang":"String",
        "shenhe":"String",
        "yujifahuo_date":"2021-10-02",
        "hetongbh":"String",
        "addr":"String",
        "channels":"String",
        "tiaoshi_date":"2021-10-02",
        "method":"String",
        "work_month":"2001-01-01"})
    print(r,dir(r))
    print(r.text)
def getContact():
    r = httpx.get('http://127.0.0.1:8000/rest/Contact/', params={'search':'','baoxiang':'','start':0,'limit':3})
    print(r,dir(r))
    print(r.text)
def deleteContact():
    r = httpx.delete('http://127.0.0.1:8000/rest/Contact/1185')
    print(r,dir(r))
    print(r.text)
newContact()
#updateContact()
#getContact()
# deleteContact()
